home *** CD-ROM | disk | FTP | other *** search
- Path: yama.mcc.ac.uk!usenet
- From: Christos Dimitrakakis <mbge4cd1@fs1.ee.man.ac.uk>
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: 680X0 -> PPC translator?
- Date: Wed, 17 Apr 1996 17:53:11 +0100
- Organization: Sirius Cybernetics Corporation
- Message-ID: <317521F7.56BA@fs1.ee.man.ac.uk>
- References: <31499F8E.26A9@netvision.net.il> <volker.0fw1@vb.franken.de> <19960408.40F118.E8F9@an052.du.pipex.com> <316BD11F.69A7@netvision.net.il> <19960410.413918.CA24@aj158.du.pipex.com> <316FE1A5.3A1F@netvision.net.il> <19960413.4A71D0.E501@an089.du.pipex.com> <3174A593.5045@sapiens.com>
- NNTP-Posting-Host: meehph.ee.man.ac.uk
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.01 (X11; I; HP-UX A.09.03 9000/715)
-
- Static translators cannot work.
- You would be better off with a semi-dynamic translator.
- Why?
- Even the problem of loading a program in memory
- is almost insoluble, if the program contains data.
- Let's say you trace all calls and rets etc, so that you can
- exclude some part of the data of been executable.
- But how about indexed calls? You cannot handle those statically,
- especially if they are taking data from a variable index
- specifying a variable memory location.
-
- Anyway, the best way to go is semi-static translation.
- How it will work?
- The same way as a cache!
- Everytime the Virtual Program Counter (VPC) reaches a new address,
- the Virtual Cache (VCache) is checked to see if that address is
- contained.
- If it is, the corresponding PPC command in the VCache is executed,
- else the 68k code is interpreted and is placed into the VCache as a PPC
- instruction, which then can be executed from the VCache directly.
- By careful design of the VCache, most programs can be executed from
- VCache memory 99% of the time and the supervising program will not
- have to interfere a lot.
- Note, though, that you must provide a place where the original data is
- stored , which must be seperate from VCache memory.
- In essence, this method is a cached dynamic translation method, where
- parts of code that have already been translated, need not be translated
- again.
- And if it is speed that you're looking for, then this is your answer.
-
-
- As for more examples of how you can have code that is impossible to
- translate
- statically, I suggest you look at the protection methods used by some of
- the
- spectrum programmers back in the 80s, which did not rely in strange tape
- formatting, but in strange assembler programming - producing code that
- cannot
- be statically translated. I've read some articles about some of the
- protection
- mechanisms and believe me, they were weird.
-